//
//  UIImageView+SEGWebCache.h
//  Commom
//
//  Created by Clavis on 2020/10/23.
//

#import <UIKit/UIKit.h>
#import <UIImageView+WebCache.h>
#import "ImageEnarge.h"

@interface UIImageView (SEGWebCache)

- (void)setImageWithURL:(nullable NSURL *)url;

- (void)setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder;

- (void)setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options;

- (void)setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context;

- (void)setImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock;

- (void)setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock;

- (void)setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock;

- (void)setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock;

- (void)setImageWithURL:(nullable NSURL *)url
          placeholderImage:(nullable UIImage *)placeholder
                   options:(SDWebImageOptions)options
                   context:(nullable SDWebImageContext *)context
                  progress:(nullable SDImageLoaderProgressBlock)progressBlock
              completed:(nullable SDExternalCompletionBlock)completedBlock;



#pragma mark 图片缓存存取与读取

//保存与读取缓存内的图片
+(NSData *)saveServiceImage:(NSURL *)url;

+ (NSData*)saveServiceImage:(NSURL*)url isSmall:(BOOL)isSmall;

+(NSData *)saveServiceImage:(NSURL *)url imageView:(UIImageView *)imageView;

+(NSData*)saveServiceImage:(NSURL*)url aImageView:(UIImageView*)aImageView isSmall:(BOOL)isSmall;

//压缩图片到指定大小
+ (UIImage*)scaleImage:(UIImage*)aImage scaledToSize:(CGSize)aSize;

@end

